package cn.wjzhang.middle.modules.shortMes.controller;

import cn.wjzhang.core.annotation.AutoLog;
import cn.wjzhang.core.beans.vo.Result;
import cn.wjzhang.middle.beans.request.MidShortMesRequest;
import cn.wjzhang.middle.modules.shortMes.service.MidShortMesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * ========================
 * 短信
 *
 * @author wjzhang
 * @version v1.0
 * ========================
 * @date 2023/6/25 14:25
 */
@Slf4j
@Api(tags = "短信")
@RestController
@RequestMapping("/v1/shortMes")
public class MidShortMesController {

    @Resource
    private MidShortMesService midShortMesService;

    @ApiOperation("验证码")
    @PostMapping("/sendCode")
    @AutoLog(value = "短信验证码")
    public Result<?> sendCode(@Validated @RequestBody MidShortMesRequest request, BindingResult bindingResult) {
        return midShortMesService.sendCode(request);
    }

}
